home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / NKFLARE.ZIP / NKFlare.txt < prev    next >
Encoding:
Text File  |  1997-09-09  |  35.7 KB  |  787 lines

  1.  
  2.           N K F l a r e . I N C
  3. ------------------------------------------
  4.  
  5.    Lens Flare "plug-in" for POV-RAY 3.0
  6.  
  7.  Copyright (C) 1997           Nathan Kopp
  8.  
  9.  Version 4.0                 August, 1997
  10.  
  11. ------------------------------------------
  12.  
  13. *************************************************************************
  14.                           *** CONTENTS ***
  15. *************************************************************************
  16.  
  17.   - Introduction and General Use
  18.   - New features - IMPORTANT UPGRADE INFORMATION
  19.   - Pre-Defined Flares
  20.   - Hiding your Flare
  21.   - Hints, Tips, and Troubleshooting
  22.   - Legal Stuff
  23.   - Appendix A - Advanced Flare Attributes
  24.   - Appendix B - Primary flare parts breakdown
  25.  
  26.  
  27. *************************************************************************
  28.                 *** INTRODUCTION AND GENERAL USE ***
  29. *************************************************************************
  30.  
  31. NKFlare is a very flexible lens flare include file for POV-Ray 3.0.
  32.  
  33. -------------------------------------------------------------------------
  34. Installation Instructions for NKFlare
  35. -------------------------------------------------------------------------
  36. Unzip NKFlare.zip to any directory you want to.  ;)
  37.  
  38. Here are the files that you should find:
  39. NKFlare.txt - this text file
  40. NKFlare.inc - the lens flare inc file
  41.       *.flr - preset flare definition files
  42.   test*.pov - test files
  43.  
  44. Next, you need to do one of the following:
  45.   1)  Copy NKFlare.inc and all of the FLR files to your povray "include"
  46.       directory (folder).
  47.   2)  Add the directory that contains NKFlare.inc and all of the FLR
  48.       files to your library path.  (See section 6.2.2.6 in the POV-Ray
  49.       documentation for more information on the library path.)
  50. -------------------------------------------------------------------------
  51.  
  52. Adding lens flare to your POV scene is now a simple as adding the 
  53. following few lines to your scene description file:
  54.  
  55.  #declare cam_loc = <x,y,z>   // use the x, y, and z of your camera
  56.  #declare light_loc = <x,y,z> // use the x, y, and z of the light
  57.                               // you wish to flare
  58.  #declare lookat = <x,y,z>    // the look_at vector of your camera
  59.  #declare sky_vect = <x,y,z>  // the sky vector of your camera
  60.  #include "35mm.flr"          // or whatever pre-defined flare you like
  61.  #include "nkflare.inc"       // create the lens flare
  62.  
  63. NKFlare will track the specified light_source even in animations as
  64. long as the above variables are equal to the positions of their
  65. respective objects in the scene.  Keep this in mind when you start
  66. rotating and translating lights and the camera.  You may need to use
  67. POV functions such as VROTATE to transform the camera's coordinates
  68. before you include NKFlare.  This is also true for the location of
  69. things like the light, the planet, etc.
  70.  
  71. Example:
  72.   camera {
  73.     location  < 0,  0,  0>
  74.     direction < 0,  0,  1>
  75.     up        < 0,  1,  0>
  76.     right     < 1,  0,  0>
  77.     rotate    <30, 60, 30>
  78.     translate < 5,  3,  4>
  79.     look_at   < 0,  0,  0>
  80.   }
  81.   #declare cam_loc = <0, 0, 0>
  82.   #declare cam_loc = vrotate(cam_loc, <30, 60, 30> )
  83.   #declare cam_loc = cam_loc + <5, 3, 4>
  84.  
  85. There are also three other special variables that can be used to easily
  86. modify the lens flare.  These are:
  87.  
  88.  - flare_size          Specifies the scale factor of the lens flare.
  89.    (flare_scale_factor) A value of 2 doubles the flare size, while a
  90.                         value of .5 halves it, as you would expect.
  91.  - flare_amount        This is a number from 0 to 1, 0 being no flare
  92.                         and 1 being the regular amount.  Use about
  93.                         0.5 for bright scenes.
  94.  - flare_brightness    This is a number from 0 to inf.  Zero makes the
  95.                         flare black.  1 is normal (good for black
  96.                         scenes).  1.5 is good for bright scenes.
  97.  - show_flare_source   This boolean varable (yes or no value) can be
  98.                         used to make the flare source transparant.  By
  99.                         default, NKFlare will create a bright spot at
  100.                         the center of the flare.  Use
  101.                           #declare show_flare_source = no
  102.                         to make it more transparant.
  103.  - flare_type          Determines a predefined flare type.  See below
  104.                         for available types or use flare_type = "" to
  105.                         create your own.
  106.                        This is for backwards-compatibility only.  Setting
  107.                         this variable will include the appropriate FLR
  108.                         file.  You should use the new syntax (which is to
  109.                         include the file yourself before including NKFlare)
  110.  
  111. The lens flare can be modified in MANY other ways.  See "Appendix A - 
  112. Advanced Flare Attributes" for a reference on available parameters.
  113.  
  114. *************************************************************************
  115.                        *** NEW FEATURES ***
  116. *************************************************************************
  117.  
  118.                        >>>> Version 4.0 <<<<
  119. -------------------------------------------------------------------------
  120. 1) IMPORTANT INFO FOR PEOPLE UPGRADING
  121. -------------------------------------------------------------------------
  122.  
  123. A) LnsFlare has been renamed NKFlare (Nathan Kopp's Flare plug-in).
  124.  
  125. B) flare_scale_factor has been changed to flare_size (although the old
  126.      variable name will still work)
  127.  
  128. C) The syntax has been changed for preset flares!  Preset flare
  129.   information is now stored in FLR files, one for each flare type.  To
  130.   use a preset flare, include it before including NKFlare.
  131.  
  132.   Example:
  133.      Old way:
  134.      #declare flare_type="35mm"
  135.      #include "NKFlare.inc"
  136.  
  137.      New way:
  138.      #include "35mm.flr"
  139.      #include "NKFlare.inc"
  140.  
  141.   (At least for this version, the old way will be supported to keep
  142.    the old scenes working.  Declaring flare_type will simply include
  143.    the appropriate file.)
  144.  
  145.   The reason for this change is that you can now easily change one or
  146.   two attributes of a preset flare type:
  147.     #include "35mm.flr"
  148.     #declare source_size = source_size * 2
  149.     #include "NKFlare.inc"
  150.  
  151. -------------------------------------------------------------------------
  152. 2) NEW SPARKLE EFFECTS ADDED
  153. -------------------------------------------------------------------------
  154. The following variables were added:
  155.       crisp_star      boolean - sparkle will have crisp edges if true
  156.                        default = false
  157.       star_mirror     boolean - sparkle will be symmetric if true
  158.                        default = true
  159.       star_spread     boolean - sparkle arms spread out if ture
  160.                        default = false  (old version was true)
  161.       star_color_rand percent - randomness of sparkle color
  162.                        default = 0
  163.       star_size_rand  percent - randomness of sparkle arm length
  164.                        default = .3
  165. -------------------------------------------------------------------------
  166. 3) NEW FLARE SPOT VARIABLES ADDED
  167. -------------------------------------------------------------------------
  168. The following variables were added:
  169.       spots_auto_rotate  boolean - spots will rotate to face center if
  170.                           true;  default = false
  171.       percent_pent       percent - like percent_hex, except with
  172.                           pentagons (more realistic);  default = 0
  173.  
  174. -------------------------------------------------------------------------
  175. 4) BRIGHT_BACKGROUND and TV-DAY2 ADDED
  176. -------------------------------------------------------------------------
  177. These are somewhat related.  First, I noticed that the flares did not
  178. look good in bright scenes.  This is because they were darker than the
  179. background.  To fix this, I added a new variable.
  180. If flare_brightness and flare_amount are not declared, you can
  181. #declare bright_background = true
  182.  
  183. This will set the two variables to values that make the flares look
  184. good in most bright scenes.  The flare becomes brighter and more
  185. transparant, depending on the background for much of it light and color.
  186.  
  187. Also, I added a preset flare type "tv-day2" which really does look like
  188. the lens flare that you see on tv in daylight shows.  (Kinda like 105mm
  189. but with more flare spots and some pentagon shaped spots.)
  190.  
  191.  
  192.                     >>>> Version 3.0 final <<<<
  193. -------------------------------------------------------------------------
  194. 1) FLARE_BRIGHTNESS ADDED
  195. -------------------------------------------------------------------------
  196. "flare_brightness", a new option (global to the entire flare), has been
  197. added.  This option changes the ambient settings of the flare's finish.
  198. Use flare_brightness if the flare is darker than the rest of the image.
  199. Two other new options added are "flare_scallop_wave" and "crisp_star",
  200. which are explained below in appendix A.
  201.  
  202. -------------------------------------------------------------------------
  203. 2) BUG FIXES and OTHER CHANGES
  204. -------------------------------------------------------------------------
  205. Two bugs were fixed.  First, small values of flare_size caused
  206. the flare to take on a diamond shape.  Thanks to Adrian Baumann for help
  207. with this fix.  A new setting, "AmbientLight" has been added.  If you
  208. change the global_settings{ambient_light} in your scene, declare the
  209. AmbientLight variable to match.  Thanks again to Adrian Baumann.  :)
  210.  
  211. Changed sphere_size to disc_size.
  212.  
  213.                      >>>> Version 3.0 beta <<<<
  214. -------------------------------------------------------------------------
  215. 1) NEW FLARE TYPES
  216. -------------------------------------------------------------------------
  217. Nine new flare types include "Space2", "Space3", "Camcorder", "85mm",
  218. "Concert", "TV-Day", "Sports", "WarpFlare", and "Sparkle4".  Existing
  219. flare types have been fixed as well.
  220.  
  221. -------------------------------------------------------------------------
  222. 2) EVEN FASTER RENDERING / DISTORTION REMOVED
  223. -------------------------------------------------------------------------
  224. By mapping the textures to discs (rather than spheres), I've increased
  225. render speed even more.  This also removes distortion from certain flare
  226. types.
  227.  
  228. -------------------------------------------------------------------------
  229. 3) RANDOMNESS IN SPARKLE EFFECT
  230. -------------------------------------------------------------------------
  231. Randomness factors have been added to the sparkle attributes of the lens
  232. flares.  Most pre-defined flare types have been modified to reflect this
  233. new feature.
  234.  
  235. -------------------------------------------------------------------------
  236. 4) FLARE STREAKS
  237. -------------------------------------------------------------------------
  238. Two new "streaks" have been added: "streak_a" and "streak_b".  These function
  239. somewhat like "big_glow", but with some slight differences.  See "Appendix 
  240. A - Advanced Flare Attributes" for more information.  They are used to 
  241. produce the realistic "Sprots" flare, as well as adding streaks to "Space2",
  242. "Space3", and "Camcorder".
  243.  
  244.  
  245.  
  246. *************************************************************************
  247.                       *** PRE-DEFINED FLARES ***
  248. *************************************************************************
  249.  
  250. NKFlare now includes 21 preset lens flares.  To use a preset flare,
  251. include the file that goes with the flare.(e.g. #include "35mm.flr").
  252. Available presets are as follows:
  253.  
  254.  - Space1  SPACE1.FLR
  255.      The Space1 flare is very similar to the default flare.  It four
  256.      pronounced sparkle arms.  It also has smaller and more random
  257.      flare spots.
  258.  
  259.  - Space2  SPACE2.FLR
  260.      This flare looks good for some space animations,
  261.      like exploding stars.  This flare has a horizontal streak and a
  262.      orangish tint to it.
  263.  
  264.  - Space3  SPACE3.FLR
  265.      This flare also looks good for some space
  266.      animations.  It has a horizontal streak and a bluish tint to it.
  267.  
  268.  - SmallStar  SMLSTAR.FLR
  269.      This flare looks good for adding sparkle to a small distant star.
  270.      It is a very faint flare.
  271.  
  272.  - BigStar  BIGSTAR.FLR
  273.      This flare looks good for adding sparkle to a star that is closer
  274.      to the camera.  It has a yellowish "glow" to it but retains the four
  275.      faint arms of SmallStar.
  276.  
  277.  - Sparkle1  SPARKLE1.FLR
  278.      This small flare is great for adding sparkle to a glare or to a small
  279.      light such as a Christmas tree light or a taillight on a car.  It has
  280.      a faint glow and four thin sparkle arms.  This flare should be colored
  281.      by specifying "#declare source_color = <r,g,b>". Default color = <1,1,1>.
  282.  
  283.  - Sparkle2  SPARKLE2.FLR
  284.      This small flare is similar to Sparkle1, but has 6 arms instead of 4.
  285.      This flare is also bigger and has more of a glow to the light source.
  286.      This flare should also be colored by specifying "#declare source_color
  287.      = <r,g,b>".  Do not oversaturate this color... values like <.5,.5,1> for
  288.      blue is better than <0,0,1>.  Default color = <1,1,1>.
  289.  
  290.  - Sparkle3  SPARKLE3.FLR
  291.      This small flare is similar to Sparkle2, but has 8 arms instead of 6 and
  292.      also has 16 smaller sparkle arms.  As with the other two sparkles, this
  293.      flare should be colored by specifying "#declare source_color = <r,g,b>".
  294.      Do not oversaturate this color... values like <.5,.5,1> for blue is
  295.      better than <0,0,1>.  Default color = <1,1,1>.
  296.  
  297.  - Sparkle4  SPARKLE4.FLR
  298.      This small flare produces a more random sparkle effect than the other
  299.      three sparkle flares.  As with the other sparkles, this flare should
  300.      be colored by specifying "#declare source_color = <r,g,b>".
  301.  
  302.  - WarpFlare  WARP.FLR
  303.      Looks like a Starship going into Warp.
  304.  
  305.  - 35mm  35MM.FLR
  306.      This flare mimics actual 35mm flare.  It's quite complicated.
  307.      Test it to see what it looks like.
  308.  
  309.  - 50mm  50MM.FLR
  310.      This flare mimics actual 50mm flare.  It's quite complicated.
  311.      Test it to see what it looks like.
  312.  
  313.  - 85mm  85MM.FLR
  314.      This flare mimics actual 85mm flare.  It's quite complicated.
  315.      Test it to see what it looks like.
  316.  
  317.  - 105mm  105MM.FLR
  318.      This flare mimics actual 105mm flare.  This bluish flare is
  319.      quite soft and lacks a primary flare ring.  Test it to see what it looks
  320.      like.
  321.  
  322.  - Camcorder  CAMCORDR.FLR
  323.      This flare mimics the flare created by a camcorder lens.
  324.  
  325.  - TV-Day  TV-DAY.FLR
  326.      Sunflare.  NOT GOOD FOR DAYLIGHT SCENES... sorry about the misleading
  327.      name.  :(
  328.  
  329.  - TV-Day2  TV-DAY2.FLR
  330.      Ok... this one looks good in the daylight.  Of course, you will
  331.      still need to set bright_background to true.
  332.  
  333.  - Concert  CONCERT.FLR
  334.      Looks like the flare from a spotlight at a rock concert.
  335.  
  336.  - Sports  SPORTS.FLR
  337.      This is the lens flare you see at all of the sports events on TV.  Use
  338.      it for bright lights and camera-flashes.  Also good for adding sparkle
  339.      to gems.  Shaped like an "X".
  340.  
  341.  - Sunset1  SUNSET1.FLR
  342.      This doesn't look good, IMHO.  It is included just because.  ;)
  343.      For sunsets, use 35/50/85/105mm and declare bright_background = true.
  344.      This flare can be used to create a sunset where you wish the flare to
  345.      cover up the light source.  This mimics a previous set of #declares that
  346.      was included in version 1.0.
  347.  
  348.  - Sunset2  SUNSET2.FLR
  349.      This doesn't look good, IMHO.  It is included just because.  ;)
  350.      For sunsets, use 35/50/85/105mm and declare bright_background = true.
  351.      This flare can be used to model a sunset where the light source is 
  352.      already created and should not be covered up.  This mimics a previous
  353.      set of #declares that was included in version 1.0.
  354.  
  355. *************************************************************************
  356.                     *** HIDING YOUR FLARE ***
  357. *************************************************************************
  358. By default, the lens flare hides when it goes behind the camera.  New in
  359. version 2.0, you can now also hide the flare behind a planet or below the
  360. horizon automatically.  The hiding is slightly limited currently, but it
  361. is a great help in most animations.
  362.  
  363. To allow the flare to go behind a planet, you must specify the location
  364. of the planet (sphere) and it's radius.
  365.   #declare planet_loc = <x,y,z>  // x,y,z coordinates of the planet
  366.   #declare planet_rad = r        // the planet's radius
  367.  
  368. To allow the flare to go below the horizon (plane), you must specify the
  369. location and normal vector of the plane.
  370.   #declare plane_loc  = <x,y,z>  // x,y,z coordinates of the plane
  371.   #declare plane_norm = <x,y,z>  // normal vector of the plane
  372.  
  373. For either of the above, you must also define the size of
  374. your light-source:
  375.   #declare light_rad = r         // the radius of the light-source
  376.  
  377. If neither of these methods is successful, you can manually hide the
  378. flare by setting the "flare_amount" variable.
  379.  
  380. *************************************************************************
  381.                *** HINTS, TIPS, AND TROUBLESHOOTING ***
  382. *************************************************************************
  383.  
  384. -------------------------------------------------------------------------
  385. Q:  Sometimes I see black spots in the flares.
  386.  
  387. A:  Increase the #max_trace_level.  The higher you set it, the better.
  388.     This can really slow down scenes that have a lot of glass, though.
  389.     Too bad.
  390.  
  391. -------------------------------------------------------------------------
  392. Q:  My scene is very bright and the flare looks ugly.
  393.  
  394. A:  You can:
  395.     1) Add this line before including NKFlare
  396.         #declare bright_background = true
  397.      or
  398.     2) Adjust the flare yourself
  399.         Turn up the flare_brightness (around 1.5 is probably good)
  400.         Turn down the flare_amount   (around 0.5 is probably good)
  401.  
  402. -------------------------------------------------------------------------
  403. Q:  I am using fog and it causes the lens flares to look strange.  This
  404.     problem is most obvious when colored fog is used.
  405.  
  406. A:  Unfortunately, there is not really an easy way around this.  The
  407.     best solution is to manually adjust all of the variables which
  408.     affect the color of the flare's components.
  409.  
  410.     You may be able to correct the problem by using a color for
  411.     flare_brightness.  (See hint below about tinting the flare.)
  412.  
  413. -------------------------------------------------------------------------
  414. Q:  I am using focal blur in my image, and the lens flare disappears.
  415.  
  416. A:  Change the "disc_size" variable.  This variable affects the size
  417.     of the discs that are used to create the lens flare.  It also
  418.     changes their location.  The value of "disc_size" represents the
  419.     distance from the camera to the discs.  In order for thoes discs
  420.     to be in focus when focal blur is used, they must be at the
  421.     focal point.  If, for example, the focal point was at "f_point",
  422.     you would use the following declaration before including NKFlare.
  423.  
  424.     #declare disc_size = vlength(f_point - cam_loc)
  425.  
  426. -------------------------------------------------------------------------
  427. Q:  When I rotate my camera or the light source, the flare doesn't follow.
  428.  
  429. A:  You need to give NKFlare the exact location of the light and camera.
  430.  
  431. You may need to use POV-Ray's vector functions such as VROTATE to find
  432. the position of the point.  This is also true for the location of
  433. things like the planet (if used).
  434.  
  435. Example:
  436.   camera {
  437.     location  < 0,  0,  0>
  438.     direction < 0,  0,  1>
  439.     up        < 0,  1,  0>
  440.     right     < 1,  0,  0>
  441.     rotate    <30, 60, 30>
  442.     translate < 5,  3,  4>
  443.   }
  444.   #declare cam_loc = <0, 0, 0>
  445.   #declare cam_loc = vrotate(cam_loc, <30, 60, 30> )
  446.   #declare cam_loc = cam_loc + <5, 3, 4>
  447.  
  448. -------------------------------------------------------------------------
  449. Q:  Can I use multiple lens flares?
  450.  
  451. A:  Yes.
  452.  
  453. -------------------------------------------------------------------------
  454. Q:  What if I want to hide the flare behind a space-ship instead of
  455.     a planet.
  456.  
  457. A:  This can usually be done by creating an imaginary "planet" of an
  458.     appropriate size.  Then tell the lens flare to hide behind a planet
  459.     of that size centered on the ship.
  460.  
  461. -------------------------------------------------------------------------
  462. Q:  The flare is really dark.
  463.  
  464. A:  If your scene adjusts the ambient_light under global_settings, you
  465.     should set the AmbientLight variable to match.
  466.  
  467. -------------------------------------------------------------------------
  468. Hint:
  469.  
  470. You can give any flare a "tint" by changing the flare_brightness
  471. variable.  Use a color vector instead of a normal float number.
  472.  
  473. For example, if you want your flare to look purplish, use the following:
  474. #declare flare_brightness = <1.25, 0.5, 1.25>
  475.  
  476. -------------------------------------------------------------------------
  477. Hint:
  478.  
  479. Don't forget to keep something visible at the spot of the light_source.
  480. This will still be needed for certain reflections (ex: sunset on water).
  481.  
  482. -------------------------------------------------------------------------
  483. Hint:
  484.  
  485. When creating flare for a lens that may or may not be centered on the
  486. camera's look_at point (such as the windshield of a car), simply point
  487. the "lookat" vector towards the center of the lens.  This will correctly
  488. orient both the sparkle arms and the multiple flare spots.
  489.  
  490. *************************************************************************
  491.                          *** LEGAL STUFF ***
  492. *************************************************************************
  493.  
  494. Disclaimer:  I am not responsible for anything negative happening to you
  495. as a result of using NKFlare.  If your dog dies of shock because the
  496. flare is so ugly, too bad.  If space aliens kidnap you because your
  497. picture of them looks too realistic, that's your problem.  Tough luck.
  498.  
  499. NKFlare is provided free of charge.  You may freely distribute it
  500. provided that this file is included.  You may make changes if you like
  501. to.  However, if you wish to distribute a modified version you must:
  502.   1) Do not try to conceal the fact that it originally was written
  503.      by Nathan Kopp.
  504.   2) Do not try to conceal the fact that it is a modified version.
  505.   3) Include this TXT file (with nothing removed - you can add your
  506.      notes in an appropriate location)
  507.      * Do include contact information so that users can ask you about
  508.        the changes that you have made.
  509.   4) Do not charge any money for it.
  510.  
  511. If you would like to distribute NKFlare on a CD-ROM or another form
  512. of media other than the internet, please get permission first.  My desire
  513. is for this plug-in to be freely and readily available to everyone, so I
  514. will be reasonable with your requests.
  515.  
  516. If you find this useful, drop a note to me (or you could snail-mail a
  517. postcard).  :)
  518.  
  519. I (Nathan Kopp, the author) can be contacted at:
  520.   nkopp@grfn.org
  521.   nk80300@ltu.edu
  522.   nkopp@sunny.ncmc.cc.mi.us
  523.  
  524. If none of these work, you can probably contact me via Usenet on:
  525.   comp.graphics.rendering.raytracing
  526.  
  527. Also check out my web pages:
  528.   http://www.grfn.org/~nkopp/
  529.   http://www.grfn.org/~nkopp/flare1.html
  530.   http://www.grfn.org/~nkopp/pov/
  531.  
  532. This lens flare generator was _inspired_ by Chris Colefax's "Dome City"
  533. image.  The code was originally created by Nathan Kopp on November 3rd,
  534. 1996.  Thanks also to God for giving me the time and ability to finish
  535. this project.
  536.  
  537. *************************************************************************
  538.              *** APPENDIX A: ADVANCED FLARE ATTRIBUTES ***
  539. *************************************************************************
  540.  
  541. There are many attributes of NKFlare that can be modified with simple
  542. #declare statements.  To change these attributes, #declare their new
  543. values prior to the #include "lensflare.inc" statement.
  544.  
  545. -------------------------------------------------------------------------
  546. PRIMARY FLARE:  (centered on the light source)
  547. -------------------------------------------------------------------------
  548.  The primary flare consists of a bright center which acts as the visible
  549.  light source, since actual point lights are invisible to POV.  Further
  550.  out from the center of the flare is a semi-transparant "glow".  Even
  551.  further out is a ring-flare.  See Appendix A for a breakdown of the
  552.  primary flare's parts.
  553.  
  554.   source_size   The apparant size of the source.  default = 0.02
  555.   glow_size     The apparant size of the "glow".  default = .15
  556.   ring_size     The apparant size of the "ring".  default = .3
  557.   ring_width    The width of the "ring".          default = .1
  558.  
  559.     note: Sizes are kind of like a percentage of the overall picture.
  560.           Actual sizes will vary depending on the "distance" setting
  561.           in the camera statement.  A more telephoto lens will create
  562.           larger flares.  This is true for all xxx_size attributes.
  563.  
  564.   source_color  The color of the light source.  default = rgb <1, 1, 1>
  565.   glow_color    The color of the "glow".  default = rgb <1, 1, .7>
  566.   ring_color    The color of the "ring.  default = rgb <1, .7, .7>
  567.   source_bright The max brightness of the light source.  default = 2
  568.                   Source fades from this brightness to glow_bright.
  569.   glow_bright   The max brightness of the "glow".  default = 1.2
  570.                   Glow fades from this brightness to 1.0.
  571.     note: Brightnesses are multiplied by color to get the final
  572.           color value.
  573.  
  574.   source_tr     The minimum translucency of the source.  default = .1
  575.   glow_tr       The minimum translucency of the glow.  default = .7
  576.   ring_tr       The minimum translucency of the ring.  default = .8
  577.   source_fade   How fast the source fades off... this is a percentage
  578.                 of the distance from source_size to glow_size and is
  579.                 where color is glow_color*glow_brightness.  and transmit
  580.                 is 1/2 way between source_tr and glow_tr.  Color is
  581.                 glow_color*1 at glow_size.
  582.  flare_scallop_wave
  583.                 This causes the primary flare (source-glow-ring) to use
  584.                  a scallop_wave waveform (as opposed to the default
  585.                  ramp_wave.)  This can create smoother transitions.
  586.  
  587.  The "big glow" is a new flare attribute to version 2.0.  It is basically
  588.  a large flare glow that is unaffected by the other parts of the primary
  589.  flare.  It can be larger than the ring size.  By default, it is disabled.
  590.  This was added to create the 35mm and 50mm lens flares.
  591.  
  592.   big_glow_size  Radius of the "big glow".  default = 0
  593.   big_glow_color The color of the "big glow".  default = <1,1,1>
  594.   big_glow_tr    The minimum translucency of the "big glow".  default = 1
  595.  
  596. -------------------------------------------------------------------------
  597. FLARE STREAKS
  598. -------------------------------------------------------------------------
  599.  Flare streaks are used to produce streaks of light, usually either
  600.  horizontal or vertical, from the light source.  These streaks get thinner
  601.  as they get farther away, unlike streaks from the sparkle (see below).
  602.  The streaks are produced by mapping a wood texture to a disc and 
  603.  squishing it.
  604.  
  605.   streak_a_size         The radius of the streak.  default = 0
  606.   streak_a_color        The outer color of the streak.
  607.   streak_a_center_color The center color of the streak.
  608.   streak_a_tr           The minimum transmittance of the streak.
  609.   streak_a_scale        The streak's scale factor (x=width, y=height).
  610.   streak_a_rotate       The rotation of the streak.
  611.   streak_a_auto_rotate  Yes/No - does the flare follow the lens center?
  612.  
  613.  Similar variables exist for the second streak, "streak_b".
  614.  
  615. -------------------------------------------------------------------------
  616. SPARKLE AROUND THE LIGHT SOURCE:  (centered on the light source)
  617. -------------------------------------------------------------------------
  618.  The sparkle consists of two sets of radial arms.  The first set should
  619.  be quite large, and start to fade at a distance of star_size. The second
  620.  set is usually more in number but begins to fade at star_size/2.  To
  621.  remove the sparkle, set num_arms and num_arms2 to zero.
  622.  
  623.   star_size     The distance where the star starts to fade.  default = .2
  624.   star2_size    The size of the second star.  default = .1
  625.   num_arms      The number of arms of the sparkle.  default = 9
  626.   num_arms2     The number of little arms of the sparkle.  default = 9*2
  627.   star_width    The width of each arm.. this is a percent of the total space
  628.                  for each arm.  default = .2
  629.   star2_width   The width of the arms for the second star
  630.   star_color    The color of the sparkle.  default = rgb<1,1,1>
  631.   star_tr       The minimum translucency of the sparkle.  default = .9
  632.  
  633.   star_rand     Randomness factor for the first sparkle.  default = 0
  634.   star_rand2    Randomenss factor for the second sparkle. default = 0
  635.   star_seed     Seed value for the star.
  636.  
  637.   crisp_star    This causes the first star (not the second) to have sharp
  638.                  edges.  For an example, look at the "concert" flare type.
  639.   star_mirror     boolean - sparkle will be symmetric if true
  640.                    default = true
  641.   star_spread     boolean - sparkle arms spread out if ture
  642.                   default = false  (old version was true)
  643.   star_color_rand percent - randomness of sparkle color
  644.                    default = 0
  645.   star_size_rand  percent - randomness of sparkle arm length
  646.                    default = .3
  647.  
  648. -------------------------------------------------------------------------
  649. MULTIPLE LENS FLARE SPOTS (and dots):
  650. -------------------------------------------------------------------------
  651.  Multiple lens flares are in a line that passes through the center of
  652.  the picture (lookat point) and the primary flare (light_loc point).
  653.  The flare spots get increasingly farther apart as they get farther from
  654.  the primary flare.  The randomness of various attributes of the spots
  655.  can be set.  The randomness is a percentage of the actual value.
  656.    ex:  a spot_size_rand of .2 means that each spot will be between 80%
  657.         and 120% of it's normal size.
  658.  To turn off the spots set num_spots = 0.
  659.  
  660.   spot_size        The size of a spot.  default = .1
  661.   spot_color       The color of a spot. default = <1,1,.7>  (faded yellow)
  662.   spot_tr          Minimum translucency of a spot.  default = .9
  663.   num_spots        The number of spots on each side of the flare.
  664.                     default = 4
  665.   spot_dist        Used to compute distances between spots.  Bigger
  666.                     numbers mean farther spaced spots.  default = .2
  667.   spot_dist_pwr    Exponential growth value of the distance between the spots.
  668.                     default = 2  (quadratic)  for linear spots, use 1
  669.   skip_spots       The number of spots to skip (nearest to light source)
  670.   spot_fade_amount Allows the spots to fade as they get farther from the
  671.                     light.  default = 0.  Use small values (like .05)
  672.   spots_auto_rotate  boolean - spots will rotate to face center if
  673.                       true;  default = false
  674.  
  675.  In addition to flare spots, LnsFlare 2.0 can create flare "dots".  While
  676.  spots are more transparent on the inside (ring-like look), "dots" are
  677.  more transparent on the outside and less on the inside.  Flare dots are
  678.  generally smaller than the ring-like spots.  Increase "percent_dots" to
  679.  replace some of the flare spots with dots.  New in version 2.1 - lens flare
  680.  spots shaped like hexagons!  Use percent_hex just like you'd use percent_dots.
  681.  Hexagon spots use spot_color, spot_tr, ans spot_size.
  682.  
  683.   percent_dots    The percent of the spots that are randomly replaced with
  684.                    dots.
  685.   dot_size        The size of a dot.  default = .04
  686.   dot_color       The color of a dot. default = <.4,1,.5>  (faded green)
  687.   dot_tr          Minimum translucency of a dot. default = .75
  688.   percent_hex     The percent of the spots that are randomly replaced with
  689.                    hexagons.
  690.   percent_pent    The percent of the spots that are randomly replaced with
  691.                    pentagons.
  692.  
  693.  
  694.     note: the actual distance between spots depends on the 2D distance
  695.           between the light_source to the look_at points.  The closer
  696.           these points, the closer the spots (as you'd expect).
  697.  
  698.   spot_size_rand  The randomness of the spots' sizes.  default = 2
  699.   spot_color_rand The randomness of the spots' color.  default = 0
  700.   spot_dist_rand  Randomness of the spots' relative distance. default = 0
  701.   spot_seed       The seed for the above randoms.  default = seed(546)
  702.  
  703. -------------------------------------------------------------------------
  704. GLOBAL FLARE SETTINGS
  705. -------------------------------------------------------------------------
  706.   flare_size           specify the overall size of the lens flare
  707.   (flare_scale_factor) default = 1.0
  708.  
  709.   flare_rotate       Rotates the flare an additional amount.  This value
  710.                        is added to the calculated rotational value.  
  711.                        default = 0
  712.   flare_auto_rotate  Determines if the flare should rotate to face the
  713.                       center of the image.  Set to flase to keep the
  714.                       flare sparkle aiming towards the top of the image.
  715.  
  716.   main_flare_scale   Scale factor for the primary flare (including
  717.                       sparkle).  x=width, y=height.  Default = <1,1,1>
  718.   big_glow_scale     Scale factor for big_glow.  See above
  719.  
  720.   flare_amount       This is a number from 0 to 1, 0 being no flare
  721.                       and 1 being the regular amount.
  722.  
  723.   flare_brightness   This is a number preferrably greater than 1.  This
  724.                       adjusts the flares "ambient" finish and should be
  725.                       used if the flare is too dark for the image.
  726.  
  727.   bright_background  If this is true, NKFlare will declare flare_brightness
  728.                       and flare_amount to values that will look decent
  729.                       against a bright background (if they are undeclared)
  730.  
  731. -------------------------------------------------------------------------
  732. MISC
  733. -------------------------------------------------------------------------
  734.  
  735. ** Hiding the flare **
  736. Use the following to define the planet which your light will go behind:
  737.   #declare planet_loc = <x,y,z>  // x,y,z coordinates of the planet
  738.   #declare planet_rad = r        // the planet's radius
  739.  
  740. Use the following to define the plane which your light will go behind:
  741.   #declare plane_loc  = <x,y,z>  // x,y,z coordinates of the plane
  742.   #declare plane_norm = <x,y,z>  // normal vector of the plane
  743.  
  744. For either of the above, you must also define the size of
  745. your light-source:
  746.   #declare light_rad = r         // the radius of the light-source
  747.  
  748. ** Ambient light settings **
  749. If you use the ambient_light=<color> statement, you should also add the
  750. following line to avoid getting strange results:
  751.   #declare AmbientLight= <color> //defaults to <1,1,1>
  752.  
  753. ** Disc size **
  754. Finally, the texture is mapped to small discs which are translated to
  755. the camera location.  You can set the disc-camera distance with:
  756.   disc_size         default = .1
  757.  
  758. I do not suggest specifying a disc_size more than once.  NKFlare will
  759. automatically make sure that no disc_size is repeated if you only
  760. specify the first size (or none at all).
  761.  
  762.  
  763. *************************************************************************
  764.           *** APPENDIX B - PRIMARY FLARE PARTS BREAKDOWN ***
  765. *************************************************************************
  766.  
  767.   Position                       Color                  Transmit
  768.  ----------------------------------------------------------------------- 
  769.   0                    source_color*source_bright     source_tr
  770.   
  771.   source_size          source_color*glow_bright       source_tr
  772.   
  773.   % from source_size   glow_color*glow_bright         1/2 from source_tr
  774.    to glow_size                                        to glow_tr
  775.   
  776.   glow_size            glow_color                     glow_tr
  777.   
  778.   1/2 from glow_size   glow_color and                 100%
  779.    to ring_size         ring_color
  780.   
  781.   ring_size            ring_color                     ring_tr
  782.   
  783.   1% past ring_size    ring_color                     100%
  784.   
  785.  
  786.  
  787.